<%@page import="itsm.isperp.framework.core.context.ContextHolder"%><%@ page
	language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
  String path = request.getContextPath();
			String basePath = ContextHolder.getWebServerName(request);
%>

<div data-role="content" class="ui-content" role="main"
	style="background-color:#f8f8f8;position:absolute;left:0;right:0;bottom:0;top:0;">
	<div class="box">

		<div class="page__bd">
			<div class="weui-cells__title">账号信息</div>
			<div class="weui-cells">
				<div class="weui-cell">
					<div class="weui-cell__bd">
						<p>账号</p>
					</div>
					<div class="weui-cell__ft">${model.name }</div>
				</div>
				
				<div class="weui-cell">
					<div class="weui-cell__bd">
						<p>状态</p>
					</div>
					<div class="weui-cell__ft">${status }</div>
				</div>

				<a class="weui-cell"
					href="infoEdit?fn=姓名&cl=fullname&openid=${openid }&ov=${model.fullname}">
					<div class="weui-cell__bd">
						<p style="color:black">姓名</p>
					</div>
					<div class="weui-cell__ft">${model.fullname}</div> </a> <a
					class="weui-cell"
					href="infoEdit?fn=手机号码&cl=mobile&openid=${openid }&ov=${model.mobile}">
					<div class="weui-cell__bd">
						<p style="color:black">手机</p>
					</div>
					<div class="weui-cell__ft">${model.mobile}</div> </a> <a
					class="weui-cell"
					href="infoEdit?fn=邮箱地址&cl=email&openid=${openid }&ov=${model.email}">
					<div class="weui-cell__bd">
						<p style="color:black">邮箱</p>
					</div>
					<div class="weui-cell__ft">${model.email}</div> </a> <a
					class="weui-cell"
					href="infoEdit?fn=联系地址&cl=address&openid=${openid }&ov=${model.address}">
					<div class="weui-cell__bd">
						<p style="color:black">联系地址</p>
					</div>
					<div class="weui-cell__ft">${model.address}</div> </a> <a
					class="weui-cell"
					href="infoEdit?fn=生日&openid=${openid }&cl=birthDayDayAndMonth">
					<div class="weui-cell__bd">
						<p style="color:black">生日</p>
					</div>
					<div class="weui-cell__ft">${model.birthdayMonth}-${model.birthdayDay}</div>
				</a>


			</div>

		</div>

		<a class="weui-btn weui-btn_primary" onclick="clearReg()"> 解除绑定 </a> <a
			class="weui-btn weui-btn_default" onclick="closeWin()">取消</a>

	</div>

</div>

<div id="weui-dialog_confirm" class="weui-dialog_confirm"
	style="display:none">
	<div class="weui-mask"></div>
	<div class="weui-dialog">
		<div class="weui-dialog__hd">
			<strong class="weui-dialog__title">确认</strong>
		</div>
		<div class="weui-dialog__bd">
			是否要解除绑定？<br>
		</div>
		<div class="weui-dialog__ft">
			<a id="btnCanel" href="javascript:cancelReg();"
				class="weui-dialog__btn weui-dialog__btn_default">取消</a> <a
				id="btnOk" href="javascript:clearRegOk();"
				class="weui-dialog__btn weui-dialog__btn_primary">确定</a>
		</div>
	</div>
</div>

<script>

   function clearReg() {
		var $confirm = $('#weui-dialog_confirm');
		/* $confirm.on('touchend click', '#btnCanel', function() {
		   $confirm.hide();
		}); */
		  //$("#btnOk").bind("click",clearRegOk());
		  $confirm.show();
	}
	
	function cancelReg()
	{
	   var $confirm = $('#weui-dialog_confirm');
	   $confirm.hide();
	}
	
 	function closeWin()
	{
	   WeixinJSBridge.invoke('closeWindow', {}, function(res) {});
	} 

	function clearRegOk() {
			$.get('<%=basePath%>api/wechat/userAccount/deleteAccount?id=${model.id}&openid=${model.openid}',
			function() {
			    var $confirm = $('#weui-dialog_confirm');
			    $confirm.hide();
			    WeixinJSBridge.invoke('closeWindow', {}, function(res) {});
			});
    }
</script>
